<?php
if (!defined("_INDEX")) { header("Location: /"); die; }

require_once ADMIN.DS."/head.php";
?>
<h1>Ошибки</h1><br />
<table cellpadding='0' cellspacing='0' class='list'>
	<tr class='table_header'>
		<td width='50px'>ID</td>
		<td width='500px'>Информация</td>
		<td width='200px' class='actions'>Действия</td>
	</tr><?php
		$errors = $db->getTable("select * from `errors` order by `error_id` desc");
		foreach ($errors as $error)
		{
			echo "<tr><td>$error[error_id]</td>";
			echo "<td>";
				echo "<span class='bold'>IP пользователя:</span> $error[user_ip]<br />";
				echo "<span class='bold'>Страница:</span> <a href='$error[page]' target='_blank'>$error[page]</a><br />";
				echo "<span class='bold'>Сообщение:</span> $error[message]";
			echo "</td>";
			echo "<td class='actions'><a href='/admin/errors/delete/$error[error_id]' class='delete'>Удалить</a></td></tr>";
		}
?></table>

<?php require_once ADMIN.DS."/footer.php"; ?>